﻿<UserControl x:Class="Jbe.TestSuite.LogViewer.Demo.Presentation.LogDemoView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:i="http://www.codeplex.com/CompositeExtensions/TestSuite/Interface"
    xmlns:p="clr-namespace:Jbe.TestSuite.LogViewer.Demo.Properties"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:cae="http://www.codeplex.com/CompositeExtensions"
    xmlns:diag="clr-namespace:System.Diagnostics;assembly=System"
    cae:ResourceService.MergeSharedDictionaries="{x:Static i:ResourceHelper.SharedResourcePath}">

    <UserControl.Resources>
        <ObjectDataProvider x:Key="TraceEventTypeValues" ObjectType="sys:Enum" MethodName="GetValues">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="diag:TraceEventType" />
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </UserControl.Resources>

    <ScrollViewer VerticalScrollBarVisibility="Auto">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="11"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="11"/>
            </Grid.ColumnDefinitions>

            <Label Content="{x:Static p:Resources.EnterEvent}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Style="{StaticResource Label.Header}"/>

            <Label Content="{x:Static p:Resources.EventId}" Grid.Row="1" Grid.Column="0"/>
            <TextBox Text="{Binding LogEntry.EventId, ValidatesOnExceptions=true}" Grid.Row="1" Grid.Column="1"/>

            <Label Content="{x:Static p:Resources.Message}" Grid.Row="2" Grid.Column="0" Margin="11,7,0,0"/>
            <TextBox Text="{Binding LogEntry.Message, ValidatesOnExceptions=true}" Grid.Row="2" Grid.Column="1" Margin="11,7,0,0" />

            <Label Content="{x:Static p:Resources.Priority}" Grid.Row="3" Margin="11,7,0,0"/>
            <TextBox Text="{Binding LogEntry.Priority, ValidatesOnExceptions=true}" Grid.Row="3" Grid.Column="1" Margin="11,7,0,0" />

            <Label Content="{x:Static p:Resources.Severity}" Grid.Row="4" Margin="11,7,0,0"/>
            <ComboBox SelectedItem="{Binding LogEntry.Severity}" ItemsSource="{Binding Source={StaticResource TraceEventTypeValues}}" Grid.Row="4" Grid.Column="1" Margin="11,7,0,0"/>

            <Label Content="{x:Static p:Resources.Categories}" Grid.Row="5" Grid.Column="0" Margin="11,7,0,0"/>
            <CheckBox Content="{x:Static p:Resources.General}" IsChecked="{Binding GeneralOption}" Grid.Row="5" Grid.Column="1" Margin="11,7,0,0" VerticalAlignment="Bottom"/>
            <CheckBox Content="{x:Static p:Resources.Debug}" IsChecked="{Binding DebugOption}" Grid.Row="6" Grid.Column="1" Margin="11,7,0,0"/>
            <CheckBox Content="{x:Static p:Resources.Trace}" IsChecked="{Binding TraceOption}" Grid.Row="7" Grid.Column="1" Margin="11,7,0,0"/>

            <Label Content="{x:Static p:Resources.RaiseLogEntry}" Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="2"/>
            <Button Content="{x:Static p:Resources.Log}" Command="{Binding LogCommand}" Grid.Row="9" Grid.Column="0" Margin="11,7,0,0"/>
        </Grid>
    </ScrollViewer>
</UserControl>
